package com.foreveross.law.wps.service;

import org.springframework.oxm.jaxb.Jaxb2Marshaller;

import com.foreveross.law.wps.oa.client.GetFileListDataByType;
import com.foreveross.law.wps.oa.client.GetFileListDataByTypeResponse;



/**
 * 
 * @author CZM
 * 
 */
public class LawOAServiceClient extends BaseWpsService {
	private final static String PKG = "com.foreveross.law.wps.oa.client";
	private final static String SOAPACTIONPREFIX = "http://tempuri.org/";
	private static LawOAServiceClient oaServiceClient = null;

	private LawOAServiceClient() {
	}
	
	/**
     * 获取OAServiceClient客户端
     * @return
     */
    public static LawOAServiceClient getInstance(){
    	if(oaServiceClient==null){
    		oaServiceClient=new LawOAServiceClient();
    		Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
	        marshaller.setContextPath(PKG);
	        oaServiceClient.setDefaultUri("http://wf-test.infinitus-int.com:7000/MobileInferFace/EIAC_OA_Query.asmx");
	        oaServiceClient.setMarshaller(marshaller);
	        oaServiceClient.setUnmarshaller(marshaller);
    	}
    	return oaServiceClient;
    }
    
    /**
     * 2.1.2草稿、待办、待阅分类查询
     * @return
     */
    public GetFileListDataByTypeResponse getFileListDataByType(GetFileListDataByType req){
    	String actionName="GetFileListDataByType";
    	GetFileListDataByTypeResponse   resp=(GetFileListDataByTypeResponse )this.sendReq(req, SOAPACTIONPREFIX+actionName);
		System.out.println(resp.getGetFileListDataByTypeResult());
		return resp;
    }
}
